Skip to content

Conversation

@nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hijacking, since I approve of anything that adds parentheses.

Looks mostly good to me, but I think that printQual should also be used when printing match and function application:

$ cat test.scala
class C {
  def foo(x: Boolean) = !x
  def bar() = (if true then 1 else 2) match { case x => x }
  def baz() = (if true then identity else identity)(0)
}
$ ../bin/dotc -decompile C
/** Decompiled from ./C.tasty */
class C() {
  def foo(x: scala.Boolean): scala.Boolean = x.unary_!
  def bar(): scala.Int = if (true) 1 else 2 match {
    case x =>
      (x: scala.Int)
  }
  def baz(): scala.Any = if (true) ((x: scala.Any) => scala.Predef.identity[scala.Any](x)) else ((x: scala.Any) => scala.Predef.identity[scala.Any](x)).apply(0)

@nicolasstucki nicolasstucki merged commit 1818972 into scala:master Mar 28, 2019
@ghost ghost removed the stat:needs review label Mar 28, 2019
@nicolasstucki nicolasstucki deleted the fix-#5997 branch March 28, 2019 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants